#include <gst/gst.h>

int main(int argc, char **argv)
{
    GstElement *pipeline = NULL;
    GstElement *src = NULL;
    GstElement *filter = NULL;
    GstElement *sink = NULL;

    gst_init(&argc, &argv);

    /* create pipeline */
    pipeline = gst_pipeline_new("My-pipeline");

    /* create elements */
    src = gst_element_factory_make("fakesrc", "source");
    filter = gst_element_factory_make("identity", "filter");
    sink = gst_element_factory_make("fakesink", "sink");

    /* must add elements to pipeline before linking them */
    gst_bin_add_many(GST_BIN(pipeline), src, filter, sink, NULL);

    /* linking */
    if (! gst_element_link_many(src, filter, sink, NULL)) {
        g_warning("Failed to link elements");
    }


    return 0;
}

